var LRUCache=function(capacity){
    this.capacity=capacity
    this.ache=new Map()

}
LRUCache.prototype.get=function(key){
    if(this.cache.has(key)){
        
      const val= this.cache.get(key)
      this.cache.delet(val)
      thiscache.set(key,val)
      return val
    }
    return -1
}
LRUCache.prototype.put=function(key,value){
    if(this.ache.has(key)){  //修改
        this.ache.delete(key)
    }else if(this.cache.size>=this.capacity){  //新增加
        this.cache.delete(this.cache.keys().next().value)
    }
     this.ache.set(key,value)
}